package com.itheima.d4_jdk8_time;


class Person implements Comparable<Person> {
    int age;
    String name;

    Person(int age, String name) {
        this.age = age;
        this.name = name;
    }

    @Override
    public int compareTo(Person other) {
        return this.age - other.age; // 按年龄升序排序
    }
}


